﻿<UserControl x:Class="RealWorldStocks.Client.UI.Views.Home.HomeNewsView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:Controls="clr-namespace:RealWorldStocks.Client.UI.Controls" mc:Ignorable="d"
    xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    d:DesignHeight="480" d:DesignWidth="480">
    <UserControl.Resources>
        <DataTemplate x:Key="NewsItemTemplate">
            <HyperlinkButton Style="{StaticResource EmptyButtonStyle}" Width="430" d:DesignHeight="70" Margin="0,12">
                <i:Interaction.Behaviors>
                    <Controls:LaunchBrowserBehavior Url="{Binding Path=Url}" />
                </i:Interaction.Behaviors>
                <Grid>
                	<Grid.RowDefinitions>
                        <RowDefinition />
                		<RowDefinition />
                		<RowDefinition />
                	</Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition/>
                    </Grid.ColumnDefinitions>
                    <TextBlock TextWrapping="Wrap" Text="{Binding Title}" Style="{StaticResource PhoneTextLargeStyle}" Grid.Row="0" />
                	<TextBlock TextWrapping="Wrap" Text="{Binding ArticleDate, Converter={StaticResource RelativeDateTimeConverter}}" Grid.Row="2" Style="{StaticResource PhoneTextAccentStyle}"/>
                </Grid>
            </HyperlinkButton>
        </DataTemplate>
    </UserControl.Resources>
    <Grid x:Name="LayoutRoot">
        <ListBox x:Name="News" ItemTemplate="{StaticResource NewsItemTemplate}" />
    </Grid>
</UserControl>
